package com.encryption.controls.confirm
{
	import com.encryption.controls.confirm.event.ConfirmDialogEvent;
	
	import flash.display.DisplayObject;
	
	import mx.core.IFlexDisplayObject;
	import mx.core.IFlexModuleFactory;
	import mx.managers.PopUpManager;

	/**
	 * 确认对话框弹出管理类 
	 * @author jill
	 * 
	 */
	public class ConfirmDialogPopUpManager
	{
		
		public function ConfirmDialogPopUpManager()
		{
		}
		
		public static function addPopUp(window:ConfirmTipDialog, parent:DisplayObject,message:String, callback:Function=null, 
										modal:Boolean=false, childList:String=null, 
										moduleFactory:IFlexModuleFactory=null):ConfirmTipDialog
		{
			if(window == null){
				window = new ConfirmTipDialog();
			}
			window.addEventListener(ConfirmDialogEvent.CONFIRM, callback);
			
			window.message = message;
			PopUpManager.addPopUp(window,parent,modal, childList, moduleFactory);
			
			return window;
		}
		
		public static function centerPopUp(popUp:IFlexDisplayObject):void
		{
			PopUpManager.centerPopUp(popUp);
		}
		
		public static function removePopUp(popUp:IFlexDisplayObject):void
		{
			PopUpManager.removePopUp(popUp);
		}
	}
}